home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 15
/
BBS in a box XV-2.iso
/
Files II
/
Prog
/
B-C
/
C++ FAQ Reference 1.0.sit
/
C++ FAQ Reference 1.0.rsrc
/
TEXT_628.txt
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1993-06-30
|
375 b
|
10 lines
Provide a friend operator<<:
class X {
int i; //just for illustration
public:
friend ostream& operator<<(ostream& o, const X& x) { return o << x.i; }
//...
};
We use a friend rather than a member since the 'X' parameter is 2nd, not 1st. Input is similar, but the signature is:
istream& operator>> (istream& i, X& x); //not 'const X& x' !!